﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GMS.BIZ;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //from login, if this could be done
            //no more checking
            Session["test"].ToString();
        }
        catch
        {
            try
            {
                Label_UserName.Text = ((Account)Session["Account"]).LoginID;
            }
            catch
            {
                Response.Redirect("~/Login.aspx");
            }
        }
        if ((Account)Session["Account"] == null)
            Button_login.Text = "登录";
        else
        {
            Button_login.Text = "登出";
        }
    }

    protected void Button_login_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("~/Login.aspx");
    }
}
